﻿using System;

namespace Model
{
    /// <summary>
    /// 事件特性，用于标识事件的类型特性。最后一个参数为当前事件优先级
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
    public class ObjectEventAttribute : BaseAttribute
    {
        /// <summary>
        /// 事件优先级
        /// </summary>
        public int Priority { get; }
        /// <summary>
        /// 该事件所属的事件类别组
        /// </summary>
        public EventType[] Types { get; }

        public ObjectEventAttribute(EventType type0, int priority=999)
        {
            Priority = priority;
            this.Types = new EventType[] { type0 };
        }
        public ObjectEventAttribute(EventType type0, EventType type1, int priority=999)
        {
            Priority = priority;
            this.Types = new EventType[] { type0, type1 };
        }
        public ObjectEventAttribute(EventType type0, EventType type1, EventType type2, int priority=999)
        {
            Priority = priority;
            this.Types = new EventType[] { type0, type1, type2 };
        }
    }
}
